<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table{
            border-collapse: collapse;
        }
    </style>
</head>
<body>
<a href="{% url 'app0:add' %}">添加</a>
<div align="center">
<form action="{% url 'app0:search' %}" method="get">
    {% csrf_token %}
    <input type="text" name="name" placeholder="Search" required>
    <button type="submit">搜索</button>
    <table border="1">
        <tr>
            <th>书名</th>
{#            <th>价格</th>#}
            <th>操作</th>
        </tr>
        {% for datum in pager.object_list %}
        <tr>
            <td><a href="{% url 'app0:price' datum.id %}">{{ datum.name }}</a></td>
{#            <td>{{ datum.price }}</td>#}
            <td>
                <a href="{% url 'app0:delet' datum.id %}">删除</a>
                <a href="{% url 'app0:update' datum.id %}">修改</a>
            </td>
        </tr>
        {% endfor %}



    </table>

</form>
</div>
<div align="center">
{#    {% if paginss.has_previous %}#}
{#        <a href="?page={{ paginss.previous_page_number }}">上一页</a>#}
{#    {% endif %}#}
{#        第{{ paginss.number }} 页 共有{{ paginss.paginator.num_pages }} 页 <a href="{% url 'app0:index'  %}"></a>#}
{#    {% if paginss.has_next %}#}
{#        <a href="?page={{ paginss.next_page_number }}">下一页</a>#}
{#    {% endif %}#}
    {% for page in pagee.page_range %}
        <a href="{% url 'app0:search' page=page %}?name={{ name }}">{{ page }}</a>
    {% endfor %}
</div>
</body>
</html>
